import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      component: () => import('@/pages/main'),
      children: [
        {
          path: '/', // 首页是默认子路由，所谓为空
          name: 'home',
          component: () => import('@/pages/home')
        },
        {
          path: 'my',
          name: 'my',
          component: () => import('@/pages/my')
        }
      ]
    }, {
      path: '/product',
      component: () => import('@/pages/product'),
      children: [
        {
          path: 'goods',
          name: 'goods',
          component: () => import('@/pages/product/goods')
        }
      ]
    }

  ]
})
